using System;

namespace SMS.SMPPClient.PDU
{
	/// <summary>
	/// Represents a protocol data unit.  This class basically just defines
	/// the majority of the type enumerations for the base classes to use.
	/// </summary>
	public abstract class PDU
	{
		/// <summary>
		/// Enumerates all of the "standard" optional codes.  This is more for
		/// convenience when writing/updating this library than for end programmers,
		/// as the the TLV table methods take a ushort/UInt16 rather than an
		/// OptionalParamCodes enumeration.
		/// </summary>
		public enum OptionalParamCodes : ushort
		{
			dest_addr_subunit = 0x0005,
			dest_network_type = 0x0006,
			dest_bearer_type = 0x0007,
			dest_telematics_id = 0x0008,
			source_addr_subunit = 0x000D,
			source_network_type = 0x000E,
			source_bearer_type = 0x000F,
			source_telematics_id = 0x0010,
			qos_time_to_live = 0x0017,
			payload_type = 0x0019,
			additional_status_info_text = 0x001D,
			receipted_message_id = 0x001E,
			ms_msg_wait_facilities = 0x0030,
			privacy_indicator = 0x0201,
			source_subaddress = 0x0202,
			dest_subaddress = 0x0203,
			user_message_reference = 0x0204,
			user_response_code = 0x0205,
			source_port = 0x020A,
			destination_port = 0x020B,
			sar_msg_ref_num = 0x020C,
			language_indicator = 0x020D,
			sar_total_segments = 0x020E,
			sar_segment_seqnum = 0x020F,
			SC_interface_version = 0x0210,
			callback_num_pres_ind = 0x0302,
			callback_num_atag = 0x0303,
			number_of_messages = 0x0304,
			callback_num = 0x0381,
			dpf_result = 0x0420,
			set_dpf = 0x0421,
			ms_availability_status = 0x0422,
			network_error_code = 0x0423,
			message_payload = 0x0424,
			delivery_failure_reason = 0x0425,
			more_messages_to_send = 0x0426,
			message_state = 0x0427,
			ussd_service_op = 0x0501,
			display_time = 0x1201,
			sms_signal = 0x1203,
			ms_validity = 0x1204,
			alert_on_message_delivery = 0x130C,
			its_reply_type = 0x1380,
			its_session_info = 0x1383
		}

		/// <summary>
		/// Enumerates the type of number types that can be used for the SMSC 
		/// message
		/// sending.
		/// </summary>
		public enum TONType : byte
		{
			Unknown = 0x00,
			International = 0x01,
			National = 0x02,
			NetworkSpecific = 0x03,
			SubscriberNumber = 0x04,
			Alphanumeric = 0x05,
			Abbreviated = 0x06
		}

		/// <summary>
		/// Enumerates the number plan indicator types that can be used for the 
		/// SMSC
		/// message sending.
		/// </summary>
		public enum NPIType : byte
		{
			Unknown = 0x00,
			ISDN = 0x01,
			Data = 0x03,
			Telex = 0x04,
			LandMobile = 0x06,
			National = 0x08,
			Private = 0x09,
			ERMES = 0x0A,
			Internet = 0x0E
		}

		/// <summary>
		/// Enumerates the priority level of the message.
		/// </summary>
		public enum PriorityType : byte
		{
			Lowest = 0x00,
			Level1 = 0x01,
			Level2 = 0x02,
			Highest = 0x03
		}

		/// <summary>
		/// Enumerates the types of registered delivery.  Not all possible options 
		/// are present, just the common ones.
		/// </summary>
		public enum RegisteredDeliveryType : byte
		{
			None = 0x00,
			OnSuccessOrFailure = 0x01,
			OnFailure = 0x02
		}

		/// <summary>
		/// Enumerates the data coding types.
		/// </summary>
		public enum DataCodingType : byte
		{
			SMSCDefault = 0x00,
			IA5_ASCII = 0x01,
			OctetUnspecifiedB = 0x02,
			Latin1 = 0x03,
			OctetUnspecifiedA = 0x04,
			JIS = 0x05,
			Cyrillic = 0x06,
			Latin_Hebrew = 0x07,
			ucs2 = 0x08,
			Pictogram = 0x09,
			MusicCodes = 0x0A,
			ExtendedKanjiJIS = 0x0D,
			KS_C = 0x0E
		}

		/// <summary>
		/// Enumerates the privacy indicator types.
		/// </summary>
		public enum PrivacyType : byte
		{
			Nonrestricted = 0x00,
			Restricted = 0x01,
			Confidential = 0x03,
			Secret = 0x03
		}

		/// <summary>
		/// Enumerates the types of payload type.
		/// </summary>
		public enum PayloadTypeType : byte
		{
			WDPMessage = 0x00,
			WCMPMessage = 0x01
		}

		/// <summary>
		/// Enumerates the language types.
		/// </summary>
		public enum LanguageType : byte
		{
			Unspecified = 0x00,
			English = 0x01,
			French = 0x02,
			Spanish = 0x03,
			German = 0x04,
			Portuguese = 0x05
		}

		/// <summary>
		/// Enumerates the DPF result types.
		/// </summary>
		public enum DPFResultType : byte
		{
			DPFNotSet = 0,
			DPFSet = 1
		}

		/// <summary>
		/// Enumeration of all the PDU command types.
		/// </summary>
		public enum CommandIDType : uint
		{
			generic_nack = 0x80000000,
			bind_receiver = 0x00000001,
			bind_receiver_resp = 0x80000001,
			bind_transmitter = 0x00000002,
			bind_transmitter_resp = 0x80000002,
			query_sm = 0x00000003,
			query_sm_resp = 0x80000003,
			submit_sm = 0x00000004,
			submit_sm_resp = 0x80000004,
			deliver_sm = 0x00000005,
			deliver_sm_resp = 0x80000005,
			unbind = 0x00000006,
			unbind_resp = 0x80000006,
			replace_sm = 0x00000007,
			replace_sm_resp = 0x80000007,
			cancel_sm = 0x00000008,
			cancel_sm_resp = 0x80000008,
			bind_transceiver = 0x00000009,
			bind_transceiver_resp = 0x80000009,
			outbind = 0x0000000B,
			enquire_link = 0x00000015,
			enquire_link_resp = 0x80000015,
			submit_multi = 0x00000021,
			submit_multi_resp = 0x80000021,
			alert_notification = 0x00000102,
			data_sm = 0x00000103,
			data_sm_resp = 0x80000103
		}
	}
}
